package com.hq.fxh.No1_Infromation.Video.Adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hq.fxh.R;

/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/8/15
 * @Email xlwenhao1858@sina.com
 */


public class Adapter_VideoDetail_Tuijian extends BaseAdapter {
    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public Object getItem(int i) {
        return 1;
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View convertView, ViewGroup parent) {
        View view = convertView;
        ViewHolder viewHolder = null;
        if (view == null || !(view.getTag() instanceof ViewHolder)) {
            view = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_tuijian_news, null);
            viewHolder = new ViewHolder(view);
            view.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) view.getTag();
        }
        return view;
    }


    static class ViewHolder {
        protected TextView textTitle;
        protected ImageView newImageView;
        protected LinearLayout newsType4LinyoutAD;
        protected ImageView authorIcon;
        protected TextView authorName;
        protected LinearLayout NewsType4LinyoutAuthor;
        protected TextView copyRightName;
        protected LinearLayout NewsType4LinyoutCopyRight;
        protected TextView readNewNum;
        protected LinearLayout newsType4LinyoutNoAD;
        protected LinearLayout newsType4;

        ViewHolder(View rootView) {
            initView(rootView);
        }

        private void initView(View rootView) {
            textTitle = (TextView) rootView.findViewById(R.id.text_title);
            newImageView = (ImageView) rootView.findViewById(R.id.new_imageView);
            newsType4LinyoutAD = (LinearLayout) rootView.findViewById(R.id.newsType4_Linyout_AD);
            authorIcon = (ImageView) rootView.findViewById(R.id.author_icon);
            authorName = (TextView) rootView.findViewById(R.id.author_name);
            NewsType4LinyoutAuthor = (LinearLayout) rootView.findViewById(R.id.NewsType4_Linyout_author);
            copyRightName = (TextView) rootView.findViewById(R.id.copyRight_name);
            NewsType4LinyoutCopyRight = (LinearLayout) rootView.findViewById(R.id.NewsType4_Linyout_CopyRight);
            readNewNum = (TextView) rootView.findViewById(R.id.readNewNum);
            newsType4LinyoutNoAD = (LinearLayout) rootView.findViewById(R.id.newsType4_Linyout_NoAD);
            newsType4 = (LinearLayout) rootView.findViewById(R.id.newsType4);
        }
    }
}
